import service from "@/service";

//查询【组织列表】
export function getOrganizationManageList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-org/getListData?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//查询【租户下拉框】
export function getTenantList(parameter) {
  let { userId } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant/getByUserId?userId=${userId}`,
    method: "POST",
  });
}

//查询【组织类型下拉框】
export function getDictList(data) {
  let { dictKey = "orgType" } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-data/getDataByDictKey`,
    method: "POST",
    data: {
      dictKey,
    },
  });
}

//查询【所属租户】下拉框-2023-2-9修改
export function getNewTenantList(parameter) {
  let { userId } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant/getByUserIdPage?userId=${userId}`,
    method: "GET",
  });
}

//查询【组织类型】下拉框-2023-2-9修改
export function getNewDictList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-dict-data/getOrgTypePageData`,
    method: "GET",
    params,
  });
}

//【新增组织】
export function getOrganizationAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-org/saveOrUpdateData`,
    method: "POST",
    data,
  });
}

//查询【组织详情】
export function getOrganizationDetails(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-org/getDetail?id=${id}`,
    method: "POST",
  });
}

//【删除组织】
export function getOrganizationDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-org/deleteData?id=${id}`,
    method: "POST",
  });
}
